<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>我的主页</title>
<link rel="stylesheet" type="text/css" href="/static/css/user/reset.css"/>
<link rel="stylesheet" type="text/css" href="/static/js/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.css"/>
<link rel="stylesheet" type="text/css" href="/static/js/jquery.uniform/themes/default/css/uniform.custom.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/user/common.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/user/index.css"/>

<fmt:formatDate var="serverDate" value="${beijingDate}" type="date" pattern="yyyy/MM/dd HH:mm:ss"/>
<fmt:formatDate var="beijingDate" value="${beijingDate}" type="date" pattern="yyyy-MM-dd HH:mm:ss"/>
<script language="javascript">
	if(window.top!=window.self){
		window.top.location.href="/"; 
	}
 function killerrors() {
	 return true;
 }
 window.onerror = killerrors;
</script>
<script type="text/javascript" src="/static/js/min/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="/static/js/min/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="/static/js/min/jquery-ui-i18n.js"></script>
<script type="text/javascript" src="/static/js/jquery-validation-1.10.0/dist/jquery.validate.js"></script>
<script type="text/javascript" src="/static/js/min/jquery.uniform.min.js"></script>
<script type="text/javascript" src="/static/js/min/jquery.tipsy.min.js"></script>
<script type="text/javascript" src="/static/js/json2.js"></script>
<script type="text/javascript" src="/static/js/widgets.js"></script>
<script type="text/javascript" src="/static/js/util.js"></script>
<script type="text/javascript" src="/static/js/date.js"></script>
<%@ include file="/jsp/common/cookie_util.jsp"%>
<c:if test="${!empty errorMessage}">
<script type="text/javascript">
$(function() {
	errorDialog("${errorMessage}");
});
</script>
</c:if>
<c:if test="${!empty infoMessage}">
<script type="text/javascript">
$(function() {
	successDialog("${infoMessage}");	
});
</script>
</c:if>



<script type="text/javascript">
	var timer = null;
	var nextSecond;
	var beijingDate = new Date("${serverDate}"); //2013/04/07 11:57:06 
	var dateTimeStamp = beijingDate.getTime();
	function showTimeZone(){
		if(dateTimeStamp<=0){
			window.clearInterval(timer);    //清空计时器，停止调用函数
		}
		nextSecond = new Date(dateTimeStamp);
		$("#beijing_time").html(nextSecond.format("yyyy-MM-dd hh:mm:ss"));    //引用了 /static/js/date.js中的format()函数
		dateTimeStamp += 1000;
	}
	
	jQuery(function($) {
		timer = window.setInterval("showTimeZone()", 1000);	  //设置一个定时器 ,就是每隔1000毫秒调用一次showTimeZone()函数
	});
</script>

<script type="text/javascript">
	function getData() {
		alert(1);
		$.ajax({
            type:"POST",
            url:"/user/login/check",
            data:{userName:$("#txtUser").val(),userPwd:$("#txtPassword").val()},
            beforeSend:function(){$("#msg").html("logining");},             
            success:function(data){
           $("#msg").html(decodeURI(data));            
            }            
         });
	}
	
	jQuery(function($) {
		timer = window.setInterval("getData()", 30000);	  //设置一个定时器 ,就是每隔30秒调用一次showTimeZone()函数
	});
</script>


</head>

<body>
<c:if test="${empty currentUser }">
	<div id="remindBar" style="display: none;">
		<table width="100%" height="40" bgcolor="#FFFFCC" align="center" style="">
			<tbody>
				<tr>
					<td align="center" style="font-size: 16px;">
						您的浏览器可能与本站点不兼容，建议您使用IE7或Firefox3.6及以上版本！&nbsp;&nbsp;&nbsp;
						<a class="remind_link" type="button" href="javascript:closeRemindBar();">&nbsp;&nbsp;不再提醒&nbsp;&nbsp;</a>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</c:if>
<jsp:include page="header.jsp" />

<div id="head_bar">
  <div class="nav_profile" >
  	<c:if test="${!empty currentUser}">
  		<img style="float: left; margin-right: 10px;margin-top: 14px;_margin-top: 0px;" class="png" src="/static/images/header_bar_01.png" width="14" height="16" align="absmiddle" />
  		<span class="nav_name" title="${currentUser.trueName }">欢迎您，${currentUser.trueName }&nbsp;&nbsp;</span>
  		<a style="display:inline-block;text-decoration: underline;" href="javascript:void(0);" onclick="logout();return false;">退出</a>
  	</c:if>
  	<c:if test="${empty currentUser }">
  		<img class="png" src="/static/images/header_bar_01.png" width="14" height="16" align="absmiddle" />
  		<a href="javascript:login();">登录</a>
  	</c:if> 
  </div>
  <div class="subnav">
  <ul>
    <c:if test="${empty currentUser}">
		<li class="sub01">
			<img src="/static/images/subnav01.png" width="20" height="20" onclick="createImmediatelyConf()"/>
			<a class="subnav_01" href="javascript:createImmediatelyConf();">即时会议</a></li>
    	<li class="sub02">
    		<img src="/static/images/subnav02.png" width="20" height="19" onclick="createReservationConf()"/>
    		<a class="subnav_02" href="javascript:createReservationConf();">预约会议</a></li>
    </c:if>
    <li class="sub03">
    	<img src="/static/images/subnav03.png" width="17" height="20" onclick="joinMeeting(2)"/>
    	<a class="subnav_03" href="javascript:joinMeeting(2);">会议号加入</a></li>
  </ul>  
  </div>
  <ul class="nav_right">
    <li class="time_bj" align="absmiddle">
		<span id="beijing_time">${beijingDate}</span>
    </li>
    <li class="language_box">
      <form name="langForm" id="langForm">
        <select name="jumpMenu_language" id="jumpMenu_language" style="padding: 2px;width: 70px;">
          <option value="zh-cn">中文</option>
<!--          <option value="en-us">English</option>-->
        </select>
      </form>
    </li>
  </ul>  
</div>
<!--${LANG['bizconf.jsp.index.res30']}-->
<div class="main_left">
<ul class="nav-menu">
  <c:if test="${!isLogined}">
	  <li class="active">
	      <a href="/user/conf/getPublicControlPadIndex" class="ico0" >
	          <span class="icon0-img"></span>
	          <span class="icon0-span">公开会议</span>
	          <span class="icon-arrow"></span>
	      </a>
	  </li>
  </c:if>
  <li>
      <a href="javascript:;" class="isParent ico1 nav-ul-on" >
          <span class="icon1-img"></span>
          <span class="icon1-span">我的会议</span>
          <span class="icon-arrow"></span>
      </a>
      <ul>
          <li class="active">
              <a href="/user/conf/getControlPadIndex?userRole=1" class="ico11">
                  <span class="icon11-img"></span>
                  <span class="icon11-span">我主持的</span>
                  <span></span>
              </a>
          </li>
          <li>
              <a href="/user/conf/getControlPadIndex?userRole=2" class="ico12">    
                  <span class="icon12-img"></span>
                  <span class="icon12-span">我参加的</span>
                  <span></span>
              </a>
          </li>
      </ul>
  </li>
  <li>
      <a href="/user/contact/goContacts" class="ico2">
          <span class="icon2-img"></span>
          <span class="icon2-span">联系人</span>
          <span></span>
      </a>
  </li>
  <li>
      <a href="/user/notice/list" class="ico3">
          <span class="icon3-img"></span>
          <span class="icon3-span">公告信息</span>
          <span></span>
      </a>
  </li>
  <c:if test="${isConfHost and siteBase.siteFlag eq 1}">
   <li>
    	<a href="<%=request.getContextPath()%>/common/billing/userBillList" class="ico9">
    	<span class="icon9-img"></span>
    	<span class="icon9-span">账单管理</span>
    	</a>
  </li>
</c:if>
  <li>
      <a href="javascript" class="isParent ico4 nav-ul-off">
          <span class="icon4-img"></span>
          <span class="icon4-span">会议报告</span>
          <span class="icon-arrow"></span> 
      </a>
      <ul style="display:none;">
          <li>
              <a href="/user/conflog/list?isCreator=true" class="ico41">
                  <span class="icon41-img"></span>
                  <span class="icon41-span">我主持的</span>
                  <span></span>
              </a>
          </li>
          <li>
              <a href="/user/conflog/list?isCreator=false" class="ico42">
                  <span class="icon42-img"></span>
                  <span class="icon42-span">我参加的</span>
                  <span></span> 
              </a>
          </li>
      </ul>
  </li>
	  <li>
	      <a href="/user/confConfig/getConfConfig" class="ico5">
	          <span class="icon5-img"></span>
	          <span class="icon5-span">会议缺省设置</span>
	          <span></span>
	      </a>
	  </li>
	  <li>
	      <a href="/user/favor/getTimeZone" class="ico6">
	          <span class="icon6-img"></span>
	          <span class="icon6-span">偏好设置</span>
	          <span></span>
	      </a>
	  </li>
	  <li>
	      <a href="/user/profile" class="ico7">
	          <span class="icon7-img"></span>
	          <span class="icon7-span">个人设置</span>
	          <span></span>
	      </a>
	  </li>
  <li>
      <a href="javascript:;" class="isParent ico8 nav-ul-off">
          <span class="icon8-img"></span>
          <span class="icon8-span">支持</span>
          <span class="icon-arrow"></span>
      </a>
      <ul style="display:none;">
            <li>
                <a href="/help" target="_blank" class="ignore ico81">
                    <span class="icon81-img"></span>
                    <span class="icon81-span">帮助</span>
                    <span></span>
                </a>
            </li>
            <li>
                <a href="/downCenter/downClient" class="ico82">    
                    <span class="icon82-img"></span>
                    <span class="icon82-span">下载中心</span>
                    <span></span>
                </a>
            </li>
        </ul>
  </li>
</ul>
</div>
<!--${LANG['bizconf.jsp.index.res34']}-->
<div class="main_right" style="margin-left: 190px;">
  	<iframe frameborder="0" width="100%" height="600" id="mainFrame" name="mainFrame" scrolling="no" src="/user/conf/getControlPadIndex?userRole=1#"></iframe>

<c:if test="${!isLogined}">
   <iframe frameborder="0" width="100%" height="600" id="mainFrame" name="mainFrame" scrolling="no" src="/user/conf/getPublicControlPadIndex"></iframe>
</c:if>
</div>
<!--${LANG['bizconf.jsp.conf_invite_recv.res15']}-->
<jsp:include page="footer.jsp" />


  <div style="display:none" id="reloadDiv">
  <form name="reLoadJoinConf" id="reLoadJoinConf" action="/join?" method="post" target="dialogFrame">
  	<input type="hidden" name="cId" id="cId" value=""/>
  	<input type="hidden" name="rId" id="rId" value=""/>
  	<input type="hidden" name="cPass" id="cPass" value=""/>
  	<input type="hidden" name="joinType" id="joinType" value=""/>
  	<input type="hidden" name="userName" id="userName" value=""/>
  	<input type="hidden" name="reload" id="reload" value=""/>
  	<input type="hidden" name="code" id="code" value=""/>
  		<!-- setCookie("reload","1,${cId},${userName},${joinType},${code},${cPass}",domain); -->
  </form>
  </div>
  <div style="display: none;" id="b_down_s"></div>
  <div class="floatContactMe" style="position: absolute;top:200px; left: 0px;width: 170px;height: 280px;display: none;">
  	
  </div>
</body>
</html>


<script type="text/javascript">

function joinMtgFromEmail(){

	<c:if test="${joinFlag==true && joinType==JOIN_TYPE_EMAIL}">

	var joinUrl="${joinUrl}";
	joinMeetingFromEmail(joinUrl);
	</c:if>
	
}
</script>
<script type="text/javascript">
	function changeLang(langVal){
		var jumpUrl="/changeLang?lang="+langVal+"&returnURL=/";
		window.location.href=jumpUrl;
	}
	function initPage(){
		var useLang="${lang}";
		$("#jumpMenu_language").val(useLang); 
		
	}
	initPage();
</script>


<script type="text/javascript">

/*
 *页面上动态调整Iframe的宽高
 */

function changeIframeSize(frameId,widthNum,heightNum){
	var frameObj=document.getElementById(frameId);
	if (frameObj){
		if (widthNum>0){
			frameObj.style.posWidth=widthNum;
			//frameObj.setAttribute("width",widthNum)
		}
		if (heightNum>0){
			//style.height
			if ($.browser.msie && $.browser.version<7) {
				frameObj.style.posHeight=heightNum;	
			} else {
				frameObj.style.height=heightNum+"px";	
			}
			//frameObj.setAttribute("height",heightNum)
		}
	} 
	$("#joinMeeting").trigger("resize");
}

jQuery(function($) {
	if ($.browser.msie && $.browser.version<7) {//for ie6 png
		$(".png").each(function() {
			$(this).attr('width',$(this).width());
			$(this).attr('height',$(this).height());
			var imgSrc = $(this).attr('src');
			$(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + imgSrc + '\', sizingMethod=\'scale\');';
			$(this).attr('src', '/static/images/blank.gif');
		});		
	}
	$('body').bind(EVENT_CREATE, function(event, result, type) {
		if(type==VIEW_TYPE.bookMeeting) {
			jumpToMeetingPanel(result);
		} else if(type==VIEW_TYPE.group){
			if(result && result.status==1){
				successDialog(result.message);
				showChildURL("/user/group/list");	
			} else {
				errorDialog(result.message);
			}
		} else if (type==VIEW_TYPE.contact) {
			if(result && result.status==1){
				successDialog(result.message);
				showURL("/user/contact/goContacts");	
			} else {
				errorDialog(result.message);
			}
		} else if(type==VIEW_TYPE.attendee){
			if(result && result.status==1){
				successDialog(result.message);
				refreshChildIframe();
			} else {
				errorDialog(result.message);
			}
		} else if(type==VIEW_TYPE.tempMeeting) {
			joinImmediatelyConf(result);
		}
	});
	$('body').bind(EVENT_UPDATE, function(event, result, type) {
		if(type==VIEW_TYPE.bookMeeting) {
			refreshChildIframe();
		}
	});

	//left menu
	$(".nav-menu").slideBar({
        clickCallback: function(elem) {
            var isIgnore = elem.hasClass("isParent");
            if (!isIgnore) {
                var href = elem.attr("href");
                var loginUser = "${user.id}";
    			if(loginUser || href=="/downCenter/downClient" || href=="/user/conf/getPublicControlPadIndex") {
                    showURL(href);	
    			} else {
    				login();
    			}
            } 
        }
    });
	
	//resize iframe height
	$("#mainFrame").load(function(){
		resizeHeight();  
		joinMtgFromEmail();
    });
	//change lang
	//$("#langForm").find("select").not(".skipThese").uniform();
	$("#langForm select").change(function () {
		var lang = $(this).val();
		changeLang(lang);
	});

	$(window).bind("resize", function() {
		resizeHeight();
		//resizeFloatBar();
	});
	//call online
	//$(".floatContactMe").callOnline();
	 
	popupNotice();
	showRemindBar();
	var needResetPass = "${needResetPass}";
	if(needResetPass != null && needResetPass =="true"){
		resetPass();
	}
	//findFastIp();
});
window.setInterval(resizeHeight, 1000);
function resizeHeight() {
	var height = $("#mainFrame").contents().find("body").height()+50;
	var screenHeight = $(window).height()-144;
	if(screenHeight>0){
		if(height<screenHeight) {
			height = screenHeight;
		}
		if(height<600){
			height = 600;
		}
		$("#mainFrame").height(height);
		$(".main_right").height(height);
		$(".main_left").height(height);	
	}
}
      
function loadImg(param) {
	if(!ISFASTIP) {
		ISFASTIP=true;
		var fastIp = $(param).attr("domain");
		$.cookie("b_down_s", fastIp);
	}
}
function reloadPage() {
	window.location.href="/";
}
//refresh Main Iframe Content
function showURL(url) {
	url = addUrlParam(url, "t", Math.random());
	$('#mainFrame').attr("src", url);
}
//refresh Child Iframe
function showChildURL(url) {
	url = addUrlParam(url, "t", Math.random());
	$("#mainFrame")[0].contentWindow.$("#contentFrame").attr("src", url);
}

function hideTabPanel(elem, callback) {
	var tabContent = window.frames["mainFrame"].document.getElementById(elem);
	if(tabContent && $(tabContent).is(":visible")){
		var icon = $(tabContent).prev().find(".panel_icon");
		hidePanel(tabContent, icon, function(){
			callback(tabContent);
		});
	} else {
		callback(tabContent);
	}	
}
function showTabPanel(elem, callback) {
	var tabContent = window.frames["mainFrame"].document.getElementById(elem);
	if(tabContent && $(tabContent).is(":hidden")){
		var icon = $(tabContent).prev().find(".panel_icon");
		showPanel(tabContent, icon, function(){
			callback(tabContent);
		});
	} else {
		callback(tabContent);
	}
}
function jumpToMeetingPanel(result) {
	$(".nav-menu li").removeClass("active");
	var favorLi = $(".nav-menu").find(".ico11").parent();
	favorLi.addClass("active");
	showURL("/user/conf/getControlPadIndex?userRole=1");
}

function jumpToFavorLi(url) {
	url+="?t="+ Math.random();
	$(".nav-menu li").removeClass("active");
	var favorLi = $(".nav-menu").find(".ico6").parent();
	favorLi.addClass("active");
	$("#mainFrame").attr("src", url); 
}

//refresh group list
function refreshGroupList() {
	showChildURL("/user/group/list");	
}
//refresh child iframe
function refreshChildIframe() {
	var iframeSrc = $("#mainFrame")[0].contentWindow.$("#contentFrame").attr("src");
	showChildURL(iframeSrc);
}
//add calendar
function addCalendar(id) {
	$("<div id=\"addCalendar\"/>").showDialog({
		"title" : "${LANG['bizconf.jsp.conf_invite_recv.res3']}",
		"dialogClass" : "ui-dialog-user",
		"url" : "/user/email/outlook",
		"data": id,
		"type" : VIEW_TYPE.calendar,
		"action" : ACTION.create,
		"width" : 484,
		"height" : 204
	});	
}

function errorDialog(message, callback) {
	$("<div id=\"errorDiv\"/>").alertDialog({
		"title" : "${LANG['bizconf.jsp.conf_invite_recv.res2']}",
		"dialogClass" : "ui-dialog-user",
		"type": "error",
		"message": message,
		"actions": ["${LANG['system.ok']}"],
		"callback": callback
	});
}

function confirmDialog(message, callback) {
	$("<div id=\"confirmDiv\"/>").alertDialog({
		"title" : "${LANG['bizconf.jsp.conf_invite_recv.res2']}",
		"dialogClass" : "ui-dialog-user",
		"type": "confirm",
		"message": message,
		"actions": ["${LANG['system.cancel']}", "${LANG['system.ok']}"],
		"callback" : callback
	});
}

function successDialog(message) {
	$("<div id=\"successDiv\"/>").alertDialog({
		"title" : "${LANG['bizconf.jsp.conf_invite_recv.res2']}",
		"dialogClass" : "ui-dialog-user",
		"message": message,
		"type": "success",
		"actions": ["${LANG['system.ok']}"]
	});
}

function logout() {
	$("<div/>").alertDialog({
		"title": "${LANG['bizconf.jsp.conf_invite_recv.res2']}",
		"dialogClass" : "ui-dialog-user",
		"message" : "${LANG['bizconf.jsp.index.res20']}?",
		"type": "confirm",
		"actions": ["${LANG['system.cancel']}", "${LANG['system.ok']}"],
		"callback" : function() {
			window.location.href="/user/logout";
			window.event.returnValue = false;
		}
	});
}
function login() {
	$("<div id=\"loginDialog\"/>").showDialog({
		"title" : "${LANG['bizconf.jsp.index.res21']}",
		"dialogClass" : "ui-dialog-user",
		"url" : "/user/login",
		"type" : VIEW_TYPE.login,
		"action" : ACTION.view,
		"width" : 604,
		"height" : 354
	});
}

function popupNotice() { 
	var noticeId = "${sysNotice.id}";
	if(noticeId){
		var existId = $.cookie("noticeId");
		if( !existId || (existId && existId!=noticeId) ){
			$("<div id=\"popupNotice\"/>").showDialog({
				"title" : "${LANG['bizconf.jsp.index.res22']}",
				"dialogClass" : "ui-dialog-user",
				"url" : "/user/notice/popUpNotice/"+noticeId,
				"type" : VIEW_TYPE.notice,
				"action" : ACTION.view,
				"width" : 677,
				"height" : 564
			});
		}		
	}
}

/*
 * ${LANG['bizconf.jsp.index.res23']}
 */
function resetPass(){
	$("<div id=\"resetPass\"/>").showDialog({
		"title" : "${LANG['bizconf.jsp.index.res24']}",
		"dialogClass" : "ui-dialog-user",
		"url" : "/user/resetPass",
		"type" : VIEW_TYPE.notice,
		"action" : ACTION.view,
		"width" : 474,
		"height" : 285
	});
}

function getMainDomain(){
	var domain=document.domain;
	if(domain!=null && domain.length>0){
		var firstDotIndex=domain.indexOf(".");
		domain=domain.substr(firstDotIndex+1);
	}
	return domain;
}

function getDomain(){
	return document.domain;
}
function setNoticeCookie(noticeId) {
	$.cookie("noticeId", noticeId, { expires: 365 ,domain:getDomain()});
}
function showRemindBar() {
	if(!$.browser.mozilla && !$.browser.msie) { 
		var remindBar = $.cookie("remindBar");
		if(!remindBar){
			$("#remindBar").show();
		}
	}
	
}
function closeRemindBar() {
	$.cookie("remindBar", true, { expires: 365 ,domain:getDomain()});
	$("#remindBar").hide();
}
function jumpToFavor() {
	var loginUser = "${user.id}";
	if(loginUser) {
		jumpToFavorLi("/user/favor/getTimeZone");
	} else {
		login();
	}
}
function getDateScopCode(date) {
	var serverDate = new Date("${serverDate}");
	var dateScopFlag = 0;
	var startTimeStamp = date.getTime();
	var dayEndTimeStamp = getDayEnd(serverDate).getTime();
	var weekEndTimeStamp = getWeekEnd(serverDate).getTime();
	var monthEndTimeStamp = getMonthEnd(serverDate).getTime();
	if(startTimeStamp<dayEndTimeStamp){
		dateScopFlag = 1;
	} else if(startTimeStamp<weekEndTimeStamp){
		dateScopFlag = 2;
	}else if(startTimeStamp<monthEndTimeStamp){
		dateScopFlag = 3;
	}else {
		dateScopFlag = 4;
	}
	return dateScopFlag;
}  
function getMonthDays(nowYear, nowMonth){  
	var monthStartDate = new Date(nowYear, nowMonth, 1);  
	var monthEndDate = new Date(nowYear, nowMonth + 1, 1);  
	var days = (monthEndDate - monthStartDate)/(1000 * 60 * 60 * 24);  
	return days;  
} 
function getDayEnd(date) {
	var tempDate = new Date();
	tempDate.setFullYear(date.getFullYear());
	tempDate.setMonth(date.getMonth());
	tempDate.setDate(date.getDate()+1);	
	tempDate.setHours(0);
	tempDate.setMinutes(0) ;
	tempDate.setSeconds(0) ;
	return tempDate;
}
function getWeekEnd(date) {
	var tempDate = new Date();
	tempDate.setFullYear(date.getFullYear());
	tempDate.setMonth(date.getMonth());
	tempDate.setDate(date.getDate()+(6-date.getDay())+1);	
	tempDate.setHours(0);
	tempDate.setMinutes(0) ;
	tempDate.setSeconds(0) ;
	return tempDate; 	
}
function getMonthEnd(date) {
	var monthDays = getMonthDays(date.getFullYear(), date.getMonth());
	var tempDate = new Date();
	tempDate.setFullYear(date.getFullYear());
	tempDate.setMonth(date.getMonth());
	tempDate.setDate(monthDays+1);	
	tempDate.setHours(0);
	tempDate.setMinutes(0) ;
	tempDate.setSeconds(0) ;	  
	return tempDate; 	
}
</script>